public class Tree {
    public static void main(String[] args) {
        TestBinaryTree testBinaryTree=new TestBinaryTree();
        TestBinaryTree.TreeNode root=testBinaryTree.createTree();

        System.out.println("=========前序遍历========");
        testBinaryTree.preOrder(root);
        System.out.println();

        System.out.println("=========中序遍历========");
        testBinaryTree.inOrder(root);
        System.out.println();

        System.out.println("=========后序遍历========");
        testBinaryTree.postOrder(root);
        System.out.println();

        System.out.println("=========节点个数========");
        testBinaryTree.size2(root);
        System.out.println(testBinaryTree.nodeSize);

        System.out.println("=========节点个数========");
        System.out.println(testBinaryTree.size(root));

        System.out.println("=========叶子节点个数========");
        System.out.println(testBinaryTree.getLeafNodeCount(root));

        System.out.println("=========叶子节点个数========");
        testBinaryTree.getLeafNodeCount2(root);
        System.out.println(testBinaryTree.leafNodeCount);

        System.out.println("=========计算第k层节点个数========");
        System.out.println(testBinaryTree.getKLevelNodeCount(root,3));

        System.out.println("=========树的最大高度========");
        System.out.println(testBinaryTree.getHeight(root));
    }
}
